package com.woniuxy.meal.common;

public class Result<T> {

    private Boolean flag;

    private Integer code;

    private String message;

    private T data;

    public static Result success(Integer code,String message,Object data ){
        Result r = new Result();
        r.setFlag(true);
        r.setCode(code);
        r.setMessage(message);
        r.setData(data);

        return r;
    }


    public static Result fail(Integer code,String message){
        Result r = new Result();
        r.setCode(code);
        r.setMessage(message);
        return r;
    }


    public Boolean getFlag() {
        return flag;
    }

    public void setFlag(Boolean flag) {
        this.flag = flag;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
